from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from puzzle.board import Board
    from puzzle.tile import TileDesc

class Transform:
    def __init__(
        self,
        td: list["TileDesc"]
    ) -> None:
        self.td: list["TileDesc"] = td
    
    @classmethod
    def construct_from_label(cls, board: "Board", labels: list[str]) -> "Transform":
        return Transform(
            [board.get_td_by_label(lb) for lb in labels] # type: ignore
        )

class Component:
    def __init__(
        self,
        transforms: list[Transform]
    ) -> None:
        self.transforms = transforms
    
class ComponentSet:
    def __init__(
        self,
        name: str,
        cs: list[Component]
    ) -> None:
        self.name = name
        self.cs = cs